﻿package	{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import PopupFromFlash;	// import the popupFromFlash class
	public class Example extends MovieClip	{
		public function Example(){
			PopupFromFlash.init();	// run this once - this will setup a function to open a new normal window if the popup function fails.
			wikipediaButton.addEventListener(MouseEvent.MOUSE_UP, function(e:MouseEvent){
					// make sure to popupFromFlash.init() before you popup anything
				PopupFromFlash.popup(
					'http://wikipedia.org',	// the targetURL
					'flashContent',	// the 'id' attribute given to the swf element (<object> or <embed>) on the html page
					{	// these are optional additional parameters, as properties of an anonymous object
					windowTitle:'Wikipedia: the free encyclopedia',	// this is what the new window will be called on browsers that support it
					windowParams:{	// another object, this one specifying the window parammeters
						width:800,
						height:600,
						status:false,
						toolbar:false,
						location:false,
						menubar:false,
						directories:false,
						scrollbars:true
					},
						// optionally, you may pass through a normal parameter string, instead of the object -
					// windowParams: 'width=800,height=600,status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1',
					useRandomSeed:'append'	// if false, default to windowTitle, if 'append', add a unique number to the end of windowTitle, if true, ignore windowTitle and just use the unique number
					}
				);
			});
			wikipediaButton.buttonMode = wikipediaButton.useHandCursor = true;
		}
	}
}


